﻿namespace Softserve.WcfServices.Logic
{
    using System;
    using Softserve.Pottery.Infrastructure;
    using Softserve.Pottery.Ordering;
    using Softserve.Pottery.Ordering.Contracts;
    using Softserve.Pottery.Ordering.Domains;

    public class OrderingLogic : IOrderingScopeContract
    {
        public OrderingLogic()
        {

        }

        public OrderingLogic(IServiceProvider provider)
        {
            controller = (OrderingController)provider.GetService(typeof(OrderingController));
        }

        #region IOrderContract       

        public bool CreateOrder(Order item)
        {
            return controller.CreateOrder(item);
        }

        #endregion

        #region IPaymentsContract

        public Payment CreatePaymen(int id, int orderId, decimal price, PaymentType paymentType)
        {
            return controller.CreatePaymen(id, orderId, price, paymentType);
        }

        #endregion

        #region Private

        private OrderingController controller;

        #endregion

    }
}
